package vip.xiaonuo.facedoor.iservice;

import vip.xiaonuo.core.pojo.httpclient.ReturnJson;
import vip.xiaonuo.facedoor.vo.dewo.AddPersonRequest;
import vip.xiaonuo.facedoor.vo.dewo.DeletePersonRequest;
import vip.xiaonuo.facedoor.vo.dewo.DeviceStateResponse;
import vip.xiaonuo.facedoor.vo.dewo.GetPersonRequest;
import vip.xiaonuo.facedoor.vo.dewo.GetPersonResponse;
import vip.xiaonuo.facedoor.vo.dewo.UpdatePersonRequest;
import vip.xiaonuo.facedoor.vo.haiqing.*;

public interface IFaceDoorDtoService {

    /**
     * 获取设备状态
     */
    DeviceStateResponse getDeviceState(String uri) throws Exception;

    /**
     * 新增人员
     * <p>
     * 0000	人员信息添加成功
     * 0101	参数有误：personnelId、name、personnelType不能为空
     * 0199	参数有误：key不能为空
     * 0201	人员信息添加失败：设备未加载完毕，请稍后再试
     * 0202	人员信息添加失败：personnelId已存在
     * 0203	人员信息添加失败：人员数量已达上限
     * 0299	人员信息添加失败：key不正确
     *
     * @return {@link ReturnJson }
     */
    ReturnJson addPerson(String uri, AddPersonRequest addPersonRequest) throws Exception;

    /**
     * 删除人员信息
     * <p>
     * 0000	人员信息删除成功
     * 0101	参数有误：personnelId和deleteAll不能都为空
     * 0102	参数有误：非法deleteAll
     * 0199	参数有误：key不能为空
     * 0201	人员信息删除失败：personnelId不存在
     * 0299	请求失败：key不正确
     *
     * @return {@link ReturnJson }
     */
    ReturnJson deletePerson(String uri, DeletePersonRequest deletePersonRequest) throws Exception;

    /**
     * 删除人员信息
     * <p>
     * 0000	人员信息删除成功
     * 0101	参数有误：personnelId和deleteAll不能都为空
     * 0102	参数有误：非法deleteAll
     * 0199	参数有误：key不能为空
     * 0201	人员信息删除失败：personnelId不存在
     * 0299	请求失败：key不正确
     *
     * @return {@link ReturnJson }
     */
    ReturnJson deleteAllPerson(String uri, DeletePersonRequest deletePersonRequest) throws Exception;

    /**
     * 修改人员信息
     * 0000	人员信息更新成功
     * 0101	参数有误：personnelId不能为空
     * 0199	参数有误：key不能为空
     * 0201	人员信息更新失败：设备未加载完毕，请稍后再试
     * 0202	人员信息更新失败：personnelId不存在
     * 0299	请求失败：key不正确
     *
     * @return {@link ReturnJson }
     */
    ReturnJson updatePerson(String uri, UpdatePersonRequest updatePersonRequest) throws Exception;

    /**
     * 查询人员信息
     *
     * @return {@link GetPersonResponse }
     */
    GetPersonResponse getPerson(String uri, GetPersonRequest getPersonRequest) throws Exception;

    static String getBaseParam(String ip, Integer port) {
        return "http://" + ip + ":" + port;
    }

    GetPersonResponse listPerson(String uri, GetPersonRequest request) throws Exception;

    BaseResponse setUserPwd(String uri, SetUserPwdRequest setUserPwdRequest, RequestHeader requestHeader)
            throws Exception;

    BaseResponse setFactoryDefault(
            String uri, SetFactoryDefaultRequest setFactoryDefaultRequest, RequestHeader requestHeader)
            throws Exception;

    BaseResponse setSysTime(String uri, SetSysTimeRequest setSysTimeRequest, RequestHeader requestHeader)
            throws Exception;

    BaseResponse openDoor(String uri, OpenDoorRequest openDoorRequest, RequestHeader requestHeader) throws Exception;

    GetAndSetGeneralParamRequest getGeneralParam(String uri, RequestHeader requestHeader) throws Exception;



    BaseResponse setGeneralParam(String uri, GetAndSetGeneralParamRequest getAndSetGeneralParamRequest, RequestHeader requestHeader) throws Exception;



    BaseResponse rebootDevice(String uri, RebootDeviceRequest rebootDeviceRequest, RequestHeader requestHeader) throws Exception;

    GetAndSetDoorCondition getDoorCondition(String uri, RequestHeader requestHeader) throws Exception;

    BaseResponse setDoorCondition(String uri, GetAndSetDoorCondition getAndSetDoorCondition, RequestHeader requestHeader) throws Exception;

    GetAndSetSoundRequest getSound(String uri, RequestHeader requestHeader) throws Exception;

    BaseResponse setSound(String uri, GetAndSetSoundRequest getAndSetSoundRequest, RequestHeader requestHeader) throws Exception;


    BaseResponse setSubscribe(String uri, SetSubscribeRequest setSubscribeRequest, RequestHeader requestHeader) throws Exception;

}
